package com.handong.handserialprogram.module.others;


import android.view.View;

import com.handong.handserialprogram.R;
import com.handong.handserialprogram.module.base.BackStackFragment;

/**
 */
public class HelpFragment extends BackStackFragment {

    private static final String TAG = HelpFragment.class.getSimpleName();

    public HelpFragment() {
    }

    public static HelpFragment newInstance() {
        HelpFragment fragment = new HelpFragment();
        return fragment;
    }

    @Override
    protected int getContentViewID() {
        return R.layout.fragment_help;
    }

    @Override
    protected void initViewByID(View contentView) {
        contentView.findViewById(R.id.helpUserInfo).setOnClickListener(this);
        contentView.findViewById(R.id.helpCreateSimpleMission).setOnClickListener(this);
        contentView.findViewById(R.id.helpExecuteMission).setOnClickListener(this);
        contentView.findViewById(R.id.helpSpecialFunction).setOnClickListener(this);
        contentView.findViewById(R.id.helpLoginOut).setOnClickListener(this);

        initHeaderLayout(R.string.title_user_help);
    }

    @Override
    public void onClick(View v) {
        if (dispatchDoubleClick()){
            return;
        }
        switch (v.getId()) {
            case R.id.helpUserInfo:
                addFrag(HelpDetailsFragment.newInstance(HelpDetailsFragment.HELP_USER_ABOUT), R.id.activity_other);
                break;
            case R.id.helpCreateSimpleMission:
                addFrag(HelpDetailsFragment.newInstance(HelpDetailsFragment.HELP_SIMPLE_MISSION), R.id.activity_other);
            break;
            case R.id.helpExecuteMission:
                addFrag(HelpDetailsFragment.newInstance(HelpDetailsFragment.HELP_CREATE_MISSION), R.id.activity_other);
                break;
            case R.id.helpSpecialFunction:
                addFrag(HelpDetailsFragment.newInstance(HelpDetailsFragment.HELP_SPECIAL_FUNCTION), R.id.activity_other);
                break;
            case R.id.helpLoginOut:
                addFrag(HelpDetailsFragment.newInstance(HelpDetailsFragment.HELP_HAND_LOGINOUT), R.id.activity_other);
                break;
            default:
                super.onClick(v);
        }
    }
}
